//
//  OAFinancialTableVCViewController.m
//  OA项目
//
//  Created by innofive on 2018/4/27.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "OAFinancialTableVC.h"

#import "OAFinancialTableCell.h"
@interface OAFinancialTableVC ()
@end

@implementation OAFinancialTableVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    NSArray *arr;
    if (self.type==openVCTypeOne) {
        arr= @[@{@"title":@"营业收入",@"imageName":@"one",@"title1":@"878.535.73"},
               @{@"title":@"营业成本",@"imageName":@"one",@"title1":@"169.412.82"},
               @{@"title":@"费用",@"imageName":@"one",@"title1":@"1.011.009.20"},
               @{@"title":@"净利润",@"imageName":@"one",@"title1":@"-301.886.29"}
               ];
    }
    else if (self.type==openVCTypeTwo)
    {
        arr= @[@{@"title":@"招标服务收入",@"imageName":@"one",@"title1":@"878.535.73"},
               @{@"title":@"标书收入",@"imageName":@"one",@"title1":@"169.412.82"},
               @{@"title":@"其他业务收入",@"imageName":@"one",@"title1":@"1.011.009.20"}
               ];
    }
    else if (self.type==openVCTypeThree)
    {
        arr= @[@{@"title":@"主要业务成本.专家费",@"imageName":@"one",@"title1":@"878.535.73"},
               @{@"title":@"人工成本",@"imageName":@"one",@"title1":@"169.412.82"},
               ];
    }
    else if (self.type==openVCTypeFour)
    {
        arr= @[@{@"title":@"办公费",@"imageName":@"one",@"title1":@"878.535.73"},
               @{@"title":@"出差旅费",@"imageName":@"one",@"title1":@"169.412.82"},
               @{@"title":@"业务招待费",@"imageName":@"one",@"title1":@"169.412.82"},
               @{@"title":@"会议费",@"imageName":@"one",@"title1":@"878.535.73"},
               @{@"title":@"车辆费",@"imageName":@"one",@"title1":@"169.412.82"},
               @{@"title":@"所得税",@"imageName":@"one",@"title1":@"169.412.82"},
               ];
    }
    else if (self.type==openVCTypeFour)
    {
        arr= @[@{@"title":@"净利润",@"imageName":@"one",@"title1":@"-301.886.29"},
               @{@"title":@"所得税",@"imageName":@"one",@"title1":@"169.412.82"},
               ];
    }
    [self.dataArr addObjectsFromArray:arr];
    
}

-(void)onLoadViewByWillAppear:(UIView *)view
{
    [self.tableView config:^(UITableView *tableView) {
        [tableView setSeparatorMan];
    }];
}

#pragma mark --点击
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    OAFinancialTableVC *vc =[[OAFinancialTableVC alloc]initWithStyle:(UITableViewStyleGrouped)];
    
    switch (indexPath.row) {
        case 0:
        {
            vc.title = @"营业收入";
            vc.type = openVCTypeTwo;
        }
            break;
        case 1:
        {
            
            vc.title = @"营业成本";
            vc.type = openVCTypeThree;
        }
            break;
        case 2:
        {   vc.title = @"费用";
            vc.type = openVCTypeFour;
        }
            break;
        default:
        {   vc.title = @"净利润";
            vc.type = openVCTypeFive;
        }
            break;
    }
    [self pushToVC:vc];
    
}


-(MCCellInfo *)tableView:(UITableView *)tableView cellForIndexPath:(NSIndexPath *)indexPath IsHeight:(BOOL)isheight
{
    return [MCCellInfo configForCellId:cell Class:[OAFinancialTableCell class] Height:kFitH(60) TableView:tableView CellStyle:(UITableViewCellStyleValue1)];
}

-(MCHFViewInfo *)tableView:(UITableView *)tableView HeaderInSection:(NSInteger)section isBiao:(BOOL)isBiao
{
    return [MCHFViewInfo configForViewId:header Class:[OAFinancialTableHeaderView class] Height:kScreenW-kFitH(50) TableView:tableView];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end

//@interface OAFinancialTable2VC ()
//@end
//
//@implementation OAFinancialTable2VC
//
//- (void)viewDidLoad {
//    [super viewDidLoad];
//
//    
//    
//    NSArray *arr = @[@{@"title":@"营业收入",@"imageName":@"one",@"title1":@"878.535.73"},
//                     @{@"title":@"营业成本",@"imageName":@"one",@"title1":@"169.412.82"},
//                     @{@"title":@"费用",@"imageName":@"one",@"title1":@"1.011.009.20"},
//                     @{@"title":@"净利润",@"imageName":@"one",@"title1":@"-301.886.29"}
//                     ];
//
//    [self.dataArr addObjectsFromArray:arr];
//
//}
//
//-(void)onLoadViewByWillAppear:(UIView *)view
//{
//    [self.tableView config:^(UITableView *tableView) {
//        [tableView setSeparatorMan];
//    }];
//}
//
//#pragma mark --点击
//-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    [tableView deselectRowAtIndexPath:indexPath animated:YES];
//
//
//}
//
//-(MCCellInfo *)tableView:(UITableView *)tableView cellForIndexPath:(NSIndexPath *)indexPath IsHeight:(BOOL)isheight
//{
//    return [MCCellInfo configForCellId:cell Class:[OAFinancialTableCell class] Height:kFitH(60) TableView:tableView CellStyle:(UITableViewCellStyleValue1)];
//}
//
//-(MCHFViewInfo *)tableView:(UITableView *)tableView HeaderInSection:(NSInteger)section isBiao:(BOOL)isBiao
//{
//    return [MCHFViewInfo configForViewId:header Class:[OAFinancialTableHeaderView class] Height:kScreenW-kFitH(50) TableView:tableView];
//}
//
//- (void)didReceiveMemoryWarning {
//    [super didReceiveMemoryWarning];
//    // Dispose of any resources that can be recreated.
//}
//
///*
// #pragma mark - Navigation
//
// // In a storyboard-based application, you will often want to do a little preparation before navigation
// - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// // Get the new view controller using [segue destinationViewController].
// // Pass the selected object to the new view controller.
// }
// */
//
//@end

//@interface OAFinancialMangerVC()<WMPageControllerDelegate,WMPageControllerDataSource>
//@property(nonatomic,strong)NSArray *Titles;
//@end
//
//
//@implementation OAFinancialMangerVC
//
//- (instancetype)init
//{
//    if (self = [super init])
//    {
//        self.titleSizeNormal = kFitW(15);
//        self.titleSizeSelected = kFitW(15);
//        self.menuViewStyle = WMMenuViewStyleLine;
//        self.menuItemWidth = [UIScreen mainScreen].bounds.size.width / self.Titles.count;
//        self.titleColorSelected = hexCOLOR(@"B68839");
//        self.progressWidth = kFitW(130);
//        self.progressColor =hexCOLOR(@"B68839");
//        self.titleColorNormal =[UIColor blackColor];
//    }
//    return self;
//
//}
//
//- (void)viewDidLoad {
//    [super viewDidLoad];
//
//    [self onSetupBackButton];
//
//    self.menuView.hasBottomLine = YES;
//
//
//    self.delegate = self;
//    self.dataSource = self;
//}
//
///**
// *  To inform how many child controllers will in `WMPageController`.
// *
// *  @param pageController The parent controller.
// *
// *  @return The value of child controllers's count.
// */
//- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController
//{
//    return self.Titles.count;
//}
//- (__kindof UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index
//{
//
//    if (index==0) {
//        OAFinancialTableVC *vc =[[OAFinancialTableVC alloc]initWithStyle:(UITableViewStyleGrouped)];
//        return vc;
//    }
//    OAFinancialTable2VC *vc =[[OAFinancialTable2VC alloc]initWithStyle:(UITableViewStyleGrouped)];
//    return vc;
//    
//    
//}
//- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index
//{
//    return self.Titles[index];
//}
//- (CGRect)pageController:(WMPageController *)pageController preferredFrameForContentView:(WMScrollView *)contentView
//{
//    return CGRectMake(0,kFitH(40),self.view.frame.size.width,self.view.frame.size.height-kFitH(40));
//}
//- (CGRect)pageController:(WMPageController *)pageController preferredFrameForMenuView:(WMMenuView *)menuView
//{
//    return CGRectMake(0, 0,self.view.frame.size.width,kFitH(40));
//}
//-(NSArray *)Titles
//{
//    if (!_Titles) {
//        _Titles = @[@"财务报表",@"明显账单"];
//    }
//    return _Titles;
//}
//@end

